// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import VueLazyLoad from 'vue-lazyload';
import infiniteScroll from 'vue-infinite-scroll'
import Vuex from 'vuex'


Vue.use(Vuex);

Vue.config.productionTip = false;

Vue.use(infiniteScroll);

Vue.use(VueLazyLoad, {
  loading: '@/../static/loading-svg/loading-bubbles.svg'
});

const store = new Vuex.Store({
  state: {
    nickName: '',
    cartCount: 0,
    isUpdateCC: true
  },
  mutations: {
    updateNickname(state, nickName) {
      state.nickName = nickName;
    },
    updateCartCount(state, cartCount) {
      state.cartCount += cartCount;
    },
    updateCC(state, isUpdate) {
      state.isUpdateCC = isUpdate;
    }
  }
});

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router, // 一级路由
  store,
  template: '<App/>',
  components: { App }
});
// .$mount('#app')
